package com.nhim.cms.admin.server;

import java.util.List;

import org.springframework.stereotype.Service;

import com.nhim.cms.dao.ContentTypeDAO;
import com.nhim.cms.domain.ContentType;
import com.nhim.cms.util.ContentTypeManager;

@Service("ContentTypeService")
public class ContentTypeService {
	public static List<ContentType> findAll() {

		return ContentTypeDAO.getInstance().findAll();
	}

	public static ContentType persit(ContentType entity) {
		try {
			return ContentTypeManager.getInstance().saveOrUpdate(entity);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;

	}
	
	public static Boolean remove(Integer id)
	{
		try {
			return ContentTypeManager.getInstance().delete(id);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}
}
